﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title>Index</title>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(
        new StyleSheet { ExtensionType = ExtensionType.ListBox }
    )
    @Html.DevExpress().GetScripts(
         new Script { ExtensionType = ExtensionType.ListBox }
    )

    <script>

        $(document).ready(function () {
            lpModal.Hide();
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
        });
        function yearTurn(year) {
            var objbtn_yearturnClient = ASPxClientButton.Cast("btn_yearturn");
            var objbtn_yearchangeClient = ASPxClientButton.Cast("btn_yearchange");
            if (confirm("确定将" + year + "结转到下一年度吗？")) {
                objbtn_yearturnClient.SetEnabled(false);
                objbtn_yearchangeClient.SetEnabled(false);
                $("#hidtype").val("Transfer");
                form1.submit();
            }
        }
        function yearChange(year) {
            var objbtn_yearchangeClient = ASPxClientButton.Cast("btn_yearchange");
            var objbtn_yearturnClient = ASPxClientButton.Cast("btn_yearturn");
            if (confirm("确定将" + year + "反结转到上一年度吗？（当前年度的数据将会被删除！请谨慎操作）")) {
                objbtn_yearchangeClient.SetEnabled(false);
                objbtn_yearturnClient.SetEnabled(false);
                $("#hidtype").val("change");
                form1.submit();

            }
        }
    
    
    </script>

</head>
<body>
    @using (Html.BeginForm("YearTransfers", "YearTransfer", FormMethod.Post, new { id = "form1" }))
    {
        <div class="div">
            <table width="99%" align="center" cellpadding="0" cellspacing="0" bordercolordark="white" bordercolorlight="#BEBEBE" id="yearQuickLink" class="tableForm">
                <tr>
                    <td align="right" class="tdClass">
                        操作说明：</td>
                    <td class="tdClass" style="line-height: 20px;">
                        1、此界面是对信息管理进行年度结转
                        <br />
                        2、此操作对系统具有全面操作性，请谨慎操作！<br />
                        3、按钮“年度结转”，表示将当前操作年度结转到下一年度<br />
                        4、按钮“年度反结转”，表示将当前操作年度反结转到上一年度（当前年度的数据将会全部删除）</td>
                </tr>
                <tr>
                    <td width="10%" align="right" class="tdClass">
                        当前操作年度：</td>
                    <td width="90%" class="tdClass">
                        <font color="red" style="font-weight: bold; font-size: 14px">@ViewData["lastYear"].ToString() </font></td>
                </tr>
                <tr>
                    <td align="right" class="tdClass">
                        选择操作： </td>
                    <td>
                        @Html.DevExpress().Button(settings =>
               {
                   settings.Name = "btn_yearturn";
                   settings.Text = "年度结转";
                   settings.ControlStyle.CssClass = "button";
                   settings.Images.Image.Url = Url.Content("~/Content/ControlImages/ok.png");
                   settings.ClientSideEvents.Click = "function(){yearTurn(" + @ViewData["lastYear"].ToString() + ")}";
               }).GetHtml()
                        @Html.DevExpress().Button(settings =>
               {
                   settings.Name = "btn_yearchange";
                   settings.Text = "年度反结转";
                   settings.ControlStyle.CssClass = "button";
                   settings.Images.Image.Url = Url.Content("~/Content/ControlImages/no.png");
                   settings.CausesValidation = false;
                   settings.ClientSideEvents.Click = "function(){yearChange(" + @ViewData["lastYear"].ToString() + ")}";

               }).GetHtml()

               @Html.Hidden("hislastYear", ViewData["lastYear"])
                  @Html.Hidden("hidtype","")
                  @Html.Hidden("hdjsAlert", ViewData["jsAlert"])
                    </td>
                </tr>
            </table>
        </div>
    }
</body>
</html>
